package com.yellowpage.ndc.service;

import java.util.List;
import java.util.Map;

import com.yellowpage.white.common.PageRender;
import com.yellowpage.white.dao.QueryAssistantSQL;
import com.yellowpage.white.service.BaseServiceImpl;
import com.yellowpage.ndc.data.ProdCustomerUid;
import com.yellowpage.ndc.dao.ProdCustomerUidDao;

public class ProdCustomerUidServiceImpl extends BaseServiceImpl implements ProdCustomerUidService {
	  private ProdCustomerUidDao prodCustomerUidDao;
	
	  public void setProdCustomerUidDao(ProdCustomerUidDao prodCustomerUidDao) {
		  this.prodCustomerUidDao = prodCustomerUidDao;
	  }
	
	
	  /* Smooth generate Method */ 
	  public ProdCustomerUid getProdCustomerUid(Long id){
	      return prodCustomerUidDao.get(id);
	  }
	  
    public List<ProdCustomerUid> getAllProdCustomerUid(){
        return prodCustomerUidDao.getAll();
    }
    
    public List<Map> queryProdCustomerUidByPage(Map queryMap, PageRender pageRender) {		
        
		QueryAssistantSQL sqlAssistant = baseDao.newQueryAssistantSQL(
				"SELECT a.ID , a.T9_NAME , a.UUID , a.SP_NAME    FROM db_ndc.prod_customer_uid a WHERE 1=1 ")
				    			.addCondition(" and ID = :id ")
							    			.addCondition(" and T9_NAME = :t9Name ")
							    			.addCondition(" and UUID = :uuid ")
							    			.addCondition(" and SP_NAME = :spName ")
							    ; 		    
		    

		List<Map> resultList = sqlAssistant.queryByPage(
				baseDao.getConnection(), queryMap, pageRender);

		return resultList;
	}
    
    
    public void saveProdCustomerUid(ProdCustomerUid prodCustomerUid){
        prodCustomerUidDao.save(prodCustomerUid);
    }
    
	  public void updateProdCustomerUid(ProdCustomerUid prodCustomerUid){
	      prodCustomerUidDao.update(prodCustomerUid);
	  }
	  
	  public void delete(List deleteList){
	      prodCustomerUidDao.remove(deleteList);
	  }
	  
	  
	 
	
}	